package huaweiod.second;

import java.util.Arrays;
import java.util.Scanner;
import java.util.StringJoiner;

/**
 * 转盘寿司
 * https://renjie.blog.csdn.net/article/details/134535459
 */
public class C5_SushiWheel {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[] price = Arrays.stream(in.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        int length = price.length;
        StringJoiner sj = new StringJoiner(" ");
        for (int index = 0; index < length; index++) {
            int ans = price[index];
            for (int next = index + 1; next < index + length; next++) {
                if (price[index] > price[next % length]) {
                    ans += price[next % length];
                    break;
                }
            }
            sj.add(String.valueOf(ans));
        }
        System.out.println(sj);
    }
}
